Skip to main content

OrmLiteDialectProviderBase<TDialect>

Assembly: ServiceStack.OrmLite.dll
View Source
Declaration
public abstract class OrmLiteDialectProviderBase<TDialect> : object, IOrmLiteDialectProvider where TDialect : IOrmLiteDialectProvider

Properties

Variables

View Source
Declaration
public Dictionary<string, string> Variables { get; set; }

ExecFilter

View Source
Declaration
public IOrmLiteExecFilter ExecFilter { get; set; }

DecimalConverter

View Source
Declaration
public DecimalConverter DecimalConverter { get; }

StringConverter

View Source
Declaration
public StringConverter StringConverter { get; }

OnOpenConnection

View Source
Declaration
public Action<IDbConnection> OnOpenConnection { get; set; }

ParamString

View Source
Declaration
public string ParamString { get; set; }

NamingStrategy

View Source
Declaration
public INamingStrategy NamingStrategy { get; set; }

StringSerializer

View Source
Declaration
public IStringSerializer StringSerializer { get; set; }

ParamNameFilter

View Source
Declaration
public Func<string, string> ParamNameFilter { get; set; }

EnumConverter

View Source
Declaration
public EnumConverter EnumConverter { get; set; }

RowVersionConverter

View Source
Declaration
public RowVersionConverter RowVersionConverter { get; set; }

ReferenceTypeConverter

View Source
Declaration
public ReferenceTypeConverter ReferenceTypeConverter { get; set; }

ValueTypeConverter

View Source
Declaration
public ValueTypeConverter ValueTypeConverter { get; set; }

SelectIdentitySql

View Source
Declaration
public virtual string SelectIdentitySql { get; set; }

CreateTableFieldsStrategy

View Source
Declaration
public Func<ModelDefinition, IEnumerable<FieldDefinition>> CreateTableFieldsStrategy { get; set; }

SqlRandom

View Source
Declaration
public virtual string SqlRandom { get; }

Fields

Log

View Source
Declaration
protected static readonly ILog Log

Converters

View Source
Declaration
public Dictionary<Type, IOrmLiteConverter> Converters

AutoIncrementDefinition

View Source
Declaration
public string AutoIncrementDefinition

DefaultValueFormat

View Source
Declaration
public string DefaultValueFormat

Methods

InitColumnTypeMap()

View Source
Declaration
protected void InitColumnTypeMap()

GetColumnTypeDefinition(Type, Nullable<Int32>, Nullable<Int32>)

View Source
Declaration
public string GetColumnTypeDefinition(Type columnType, int? fieldLength, int? scale)
Returns

System.String

Parameters
TypeName
TypecolumnType
System.Nullable<System.Int32>fieldLength
System.Nullable<System.Int32>scale

InitDbParam(IDbDataParameter, Type)

View Source
Declaration
public virtual void InitDbParam(IDbDataParameter dbParam, Type columnType)
Parameters
TypeName
IDbDataParameterdbParam
TypecolumnType

CreateParam()

View Source
Declaration
public abstract IDbDataParameter CreateParam()
Returns

IDbDataParameter

RemoveConverter<T>()

View Source
Declaration
public void RemoveConverter<T>()
Type Parameters
  • T

RegisterConverter<T>(IOrmLiteConverter)

View Source
Declaration
public void RegisterConverter<T>(IOrmLiteConverter converter)
Parameters
TypeName
ServiceStack.OrmLite.IOrmLiteConverterconverter
Type Parameters
  • T

GetConverter(Type)

View Source
Declaration
public IOrmLiteConverter GetConverter(Type type)
Returns

ServiceStack.OrmLite.IOrmLiteConverter

Parameters
TypeName
Typetype

ShouldQuoteValue(Type)

View Source
Declaration
public virtual bool ShouldQuoteValue(Type fieldType)
Returns

System.Boolean

Parameters
TypeName
TypefieldType

FromDbRowVersion(Type, Object)

View Source
Declaration
public virtual object FromDbRowVersion(Type fieldType, object value)
Returns

System.Object

Parameters
TypeName
TypefieldType
System.Objectvalue

GetConverterBestMatch(Type)

View Source
Declaration
public IOrmLiteConverter GetConverterBestMatch(Type type)
Returns

ServiceStack.OrmLite.IOrmLiteConverter

Parameters
TypeName
Typetype

GetConverterBestMatch(FieldDefinition)

View Source
Declaration
public virtual IOrmLiteConverter GetConverterBestMatch(FieldDefinition fieldDef)
Returns

ServiceStack.OrmLite.IOrmLiteConverter

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

ToDbValue(Object, Type)

View Source
Declaration
public virtual object ToDbValue(object value, Type type)
Returns

System.Object

Parameters
TypeName
System.Objectvalue
Typetype

FromDbValue(Object, Type)

View Source
Declaration
public virtual object FromDbValue(object value, Type type)
Returns

System.Object

Parameters
TypeName
System.Objectvalue
Typetype

GetValue(IDataReader, Int32, Type)

View Source
Declaration
public object GetValue(IDataReader reader, int columnIndex, Type type)
Returns

System.Object

Parameters
TypeName
IDataReaderreader
System.Int32columnIndex
Typetype

GetValues(IDataReader, Object[])

View Source
Declaration
public virtual int GetValues(IDataReader reader, object[] values)
Returns

System.Int32

Parameters
TypeName
IDataReaderreader
System.Object[]values

CreateConnection(String, Dictionary<String, String>)

View Source
Declaration
public abstract IDbConnection CreateConnection(string filePath, Dictionary<string, string> options)
Returns

IDbConnection

Parameters
TypeName
System.StringfilePath
Dictionary<System.String,System.String>options

GetQuotedValue(String)

View Source
Declaration
public virtual string GetQuotedValue(string paramValue)
Returns

System.String

Parameters
TypeName
System.StringparamValue

GetSchemaName(String)

View Source
Declaration
public virtual string GetSchemaName(string schema)
Returns

System.String

Parameters
TypeName
System.Stringschema

GetTableName(ModelDefinition)

View Source
Declaration
public virtual string GetTableName(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetTableName(ModelDefinition, Boolean)

View Source
Declaration
public virtual string GetTableName(ModelDefinition modelDef, bool useStrategy)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef
System.BooleanuseStrategy

GetTableName(String, String)

View Source
Declaration
public virtual string GetTableName(string table, string schema = null)
Returns

System.String

Parameters
TypeName
System.Stringtable
System.Stringschema

GetTableName(String, String, Boolean)

View Source
Declaration
public virtual string GetTableName(string table, string schema, bool useStrategy)
Returns

System.String

Parameters
TypeName
System.Stringtable
System.Stringschema
System.BooleanuseStrategy

GetQuotedTableName(ModelDefinition)

View Source
Declaration
public virtual string GetQuotedTableName(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetQuotedTableName(String, String)

View Source
Declaration
public virtual string GetQuotedTableName(string tableName, string schema = null)
Returns

System.String

Parameters
TypeName
System.StringtableName
System.Stringschema

GetQuotedTableName(String, String, Boolean)

View Source
Declaration
public virtual string GetQuotedTableName(string tableName, string schema, bool useStrategy)
Returns

System.String

Parameters
TypeName
System.StringtableName
System.Stringschema
System.BooleanuseStrategy

GetQuotedColumnName(String)

View Source
Declaration
public virtual string GetQuotedColumnName(string columnName)
Returns

System.String

Parameters
TypeName
System.StringcolumnName

ShouldQuote(String)

View Source
Declaration
public virtual bool ShouldQuote(string name)
Returns

System.Boolean

Parameters
TypeName
System.Stringname

QuoteIfRequired(String)

View Source
Declaration
public virtual string QuoteIfRequired(string name)
Returns

System.String

Parameters
TypeName
System.Stringname

GetQuotedName(String)

View Source
Declaration
public virtual string GetQuotedName(string name)
Returns

System.String

Parameters
TypeName
System.Stringname

GetQuotedName(String, String)

View Source
Declaration
public virtual string GetQuotedName(string name, string schema)
Returns

System.String

Parameters
TypeName
System.Stringname
System.Stringschema

SanitizeFieldNameForParamName(String)

View Source
Declaration
public virtual string SanitizeFieldNameForParamName(string fieldName)
Returns

System.String

Parameters
TypeName
System.StringfieldName

GetColumnDefinition(FieldDefinition)

View Source
Declaration
public virtual string GetColumnDefinition(FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

GetLastInsertId(IDbCommand)

View Source
Declaration
public virtual long GetLastInsertId(IDbCommand dbCmd)
Returns

System.Int64

Parameters
TypeName
IDbCommanddbCmd

GetLastInsertIdSqlSuffix<T>()

View Source
Declaration
public virtual string GetLastInsertIdSqlSuffix<T>()
Returns

System.String

Type Parameters
  • T

IsFullSelectStatement(String)

View Source
Declaration
public virtual bool IsFullSelectStatement(string sql)
Returns

System.Boolean

Parameters
TypeName
System.Stringsql

ToSelectStatement(Type, String, Object[])

View Source
Declaration
public virtual string ToSelectStatement(Type tableType, string sqlFilter, params object[] filterParams)
Returns

System.String

Parameters
TypeName
TypetableType
System.StringsqlFilter
System.Object[]filterParams

ApplyTags(StringBuilder, ISet<String>)

View Source
Declaration
protected virtual void ApplyTags(StringBuilder sqlBuilder, ISet<string> tags)
Parameters
TypeName
StringBuildersqlBuilder
ISet<System.String>tags

ToSelectStatement(QueryType, ModelDefinition, String, String, String, Nullable<Int32>, Nullable<Int32>, ISet<String>)

View Source
Declaration
public virtual string ToSelectStatement(QueryType queryType, ModelDefinition modelDef, string selectExpression, string bodyExpression, string orderByExpression = null, int? offset = null, int? rows = null, ISet<string> tags = null)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.QueryTypequeryType
ServiceStack.OrmLite.ModelDefinitionmodelDef
System.StringselectExpression
System.StringbodyExpression
System.StringorderByExpression
System.Nullable<System.Int32>offset
System.Nullable<System.Int32>rows
ISet<System.String>tags

GenerateComment(in String)

View Source
Declaration
public virtual string GenerateComment(in string text)
Returns

System.String

Parameters
TypeName
System.Stringtext

InitConnection(IDbConnection)

View Source
Declaration
public virtual void InitConnection(IDbConnection dbConn)
Parameters
TypeName
IDbConnectiondbConn

GetRowVersionSelectColumn(FieldDefinition, String)

View Source
Declaration
public virtual SelectItem GetRowVersionSelectColumn(FieldDefinition field, string tablePrefix = null)
Returns

ServiceStack.OrmLite.SelectItem

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfield
System.StringtablePrefix

GetRowVersionColumn(FieldDefinition, String)

View Source
Declaration
public virtual string GetRowVersionColumn(FieldDefinition field, string tablePrefix = null)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfield
System.StringtablePrefix

GetColumnNames(ModelDefinition)

View Source
Declaration
public virtual string GetColumnNames(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetColumnNames(ModelDefinition, String)

View Source
Declaration
public virtual SelectItem[] GetColumnNames(ModelDefinition modelDef, string tablePrefix)
Returns

ServiceStack.OrmLite.SelectItem[]

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef
System.StringtablePrefix

ShouldSkipInsert(FieldDefinition)

View Source
Declaration
protected virtual bool ShouldSkipInsert(FieldDefinition fieldDef)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

ColumnNameOnly(String)

View Source
Declaration
public virtual string ColumnNameOnly(string columnExpr)
Returns

System.String

Parameters
TypeName
System.StringcolumnExpr

GetInsertFieldDefinitions(ModelDefinition, ICollection<String>)

View Source
Declaration
public virtual FieldDefinition[] GetInsertFieldDefinitions(ModelDefinition modelDef, ICollection<string> insertFields)
Returns

ServiceStack.OrmLite.FieldDefinition[]

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef
ICollection<System.String>insertFields

ToInsertRowStatement(IDbCommand, Object, ICollection<String>)

View Source
Declaration
public virtual string ToInsertRowStatement(IDbCommand cmd, object objWithProperties, ICollection<string> insertFields = null)
Returns

System.String

Parameters
TypeName
IDbCommandcmd
System.ObjectobjWithProperties
ICollection<System.String>insertFields

ToInsertStatement<T>(IDbCommand, T, ICollection<String>)

View Source
Declaration
public virtual string ToInsertStatement<T>(IDbCommand dbCmd, T item, ICollection<string> insertFields = null)
Returns

System.String

Parameters
TypeName
IDbCommanddbCmd
<T>item
ICollection<System.String>insertFields
Type Parameters
  • T

GetInsertDefaultValue(FieldDefinition)

View Source
Declaration
protected virtual object GetInsertDefaultValue(FieldDefinition fieldDef)
Returns

System.Object

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

PrepareParameterizedInsertStatement<T>(IDbCommand, ICollection<String>, Func<FieldDefinition, Boolean>)

View Source
Declaration
public virtual void PrepareParameterizedInsertStatement<T>(IDbCommand cmd, ICollection<string> insertFields = null, Func<FieldDefinition, bool> shouldInclude = null)
Parameters
TypeName
IDbCommandcmd
ICollection<System.String>insertFields
Func<ServiceStack.OrmLite.FieldDefinition,System.Boolean>shouldInclude
Type Parameters
  • T

PrepareInsertRowStatement<T>(IDbCommand, Dictionary<String, Object>)

View Source
Declaration
public virtual void PrepareInsertRowStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args)
Parameters
TypeName
IDbCommanddbCmd
Dictionary<System.String,System.Object>args
Type Parameters
  • T

ToUpdateStatement<T>(IDbCommand, T, ICollection<String>)

View Source
Declaration
public virtual string ToUpdateStatement<T>(IDbCommand dbCmd, T item, ICollection<string> updateFields = null)
Returns

System.String

Parameters
TypeName
IDbCommanddbCmd
<T>item
ICollection<System.String>updateFields
Type Parameters
  • T

MergeParamsIntoSql(String, IEnumerable<IDbDataParameter>)

View Source
Declaration
public virtual string MergeParamsIntoSql(string sql, IEnumerable<IDbDataParameter> dbParams)
Returns

System.String

Parameters
TypeName
System.Stringsql
IEnumerable<IDbDataParameter>dbParams

GetRefSelfSql<From>(SqlExpression<From>, ModelDefinition, FieldDefinition, ModelDefinition)

View Source
Declaration
public virtual string GetRefSelfSql<From>(SqlExpression<From> refQ, ModelDefinition modelDef, FieldDefinition refSelf, ModelDefinition refModelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.SqlExpression<T>refQ
ServiceStack.OrmLite.ModelDefinitionmodelDef
ServiceStack.OrmLite.FieldDefinitionrefSelf
ServiceStack.OrmLite.ModelDefinitionrefModelDef
Type Parameters
  • From

GetRefFieldSql(String, ModelDefinition, FieldDefinition)

View Source
Declaration
public virtual string GetRefFieldSql(string subSql, ModelDefinition refModelDef, FieldDefinition refField)
Returns

System.String

Parameters
TypeName
System.StringsubSql
ServiceStack.OrmLite.ModelDefinitionrefModelDef
ServiceStack.OrmLite.FieldDefinitionrefField

GetFieldReferenceSql(String, FieldDefinition, FieldReference)

View Source
Declaration
public virtual string GetFieldReferenceSql(string subSql, FieldDefinition fieldDef, FieldReference fieldRef)
Returns

System.String

Parameters
TypeName
System.StringsubSql
ServiceStack.OrmLite.FieldDefinitionfieldDef
ServiceStack.OrmLite.FieldReferencefieldRef

PrepareParameterizedUpdateStatement<T>(IDbCommand, ICollection<String>)

View Source
Declaration
public virtual bool PrepareParameterizedUpdateStatement<T>(IDbCommand cmd, ICollection<string> updateFields = null)
Returns

System.Boolean

Parameters
TypeName
IDbCommandcmd
ICollection<System.String>updateFields
Type Parameters
  • T

AppendNullFieldCondition(StringBuilder, FieldDefinition)

View Source
Declaration
public virtual void AppendNullFieldCondition(StringBuilder sqlFilter, FieldDefinition fieldDef)
Parameters
TypeName
StringBuildersqlFilter
ServiceStack.OrmLite.FieldDefinitionfieldDef

AppendFieldCondition(StringBuilder, FieldDefinition, IDbCommand)

View Source
Declaration
public virtual void AppendFieldCondition(StringBuilder sqlFilter, FieldDefinition fieldDef, IDbCommand cmd)
Parameters
TypeName
StringBuildersqlFilter
ServiceStack.OrmLite.FieldDefinitionfieldDef
IDbCommandcmd

PrepareParameterizedDeleteStatement<T>(IDbCommand, IDictionary<String, Object>)

View Source
Declaration
public virtual bool PrepareParameterizedDeleteStatement<T>(IDbCommand cmd, IDictionary<string, object> deleteFieldValues)
Returns

System.Boolean

Parameters
TypeName
IDbCommandcmd
IDictionary<System.String,System.Object>deleteFieldValues
Type Parameters
  • T

PrepareStoredProcedureStatement<T>(IDbCommand, T)

View Source
Declaration
public virtual void PrepareStoredProcedureStatement<T>(IDbCommand cmd, T obj)
Parameters
TypeName
IDbCommandcmd
<T>obj
Type Parameters
  • T

AddParameter(IDbCommand, FieldDefinition)

Used for adding updated DB params in INSERT and UPDATE statements

View Source
Declaration
protected IDbDataParameter AddParameter(IDbCommand cmd, FieldDefinition fieldDef)
Returns

IDbDataParameter

Parameters
TypeName
IDbCommandcmd
ServiceStack.OrmLite.FieldDefinitionfieldDef

SetParameter(FieldDefinition, IDbDataParameter)

View Source
Declaration
public virtual void SetParameter(FieldDefinition fieldDef, IDbDataParameter p)
Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
IDbDataParameterp

EnableIdentityInsert<T>(IDbCommand)

View Source
Declaration
public virtual void EnableIdentityInsert<T>(IDbCommand cmd)
Parameters
TypeName
IDbCommandcmd
Type Parameters
  • T

EnableIdentityInsertAsync<T>(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task EnableIdentityInsertAsync<T>(IDbCommand cmd, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken
Type Parameters
  • T

DisableIdentityInsert<T>(IDbCommand)

View Source
Declaration
public virtual void DisableIdentityInsert<T>(IDbCommand cmd)
Parameters
TypeName
IDbCommandcmd
Type Parameters
  • T

DisableIdentityInsertAsync<T>(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task DisableIdentityInsertAsync<T>(IDbCommand cmd, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken
Type Parameters
  • T

EnableForeignKeysCheck(IDbCommand)

View Source
Declaration
public virtual void EnableForeignKeysCheck(IDbCommand cmd)
Parameters
TypeName
IDbCommandcmd

EnableForeignKeysCheckAsync(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task EnableForeignKeysCheckAsync(IDbCommand cmd, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken

DisableForeignKeysCheck(IDbCommand)

View Source
Declaration
public virtual void DisableForeignKeysCheck(IDbCommand cmd)
Parameters
TypeName
IDbCommandcmd

DisableForeignKeysCheckAsync(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task DisableForeignKeysCheckAsync(IDbCommand cmd, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken

SetParameterValues<T>(IDbCommand, Object)

View Source
Declaration
public virtual void SetParameterValues<T>(IDbCommand dbCmd, object obj)
Parameters
TypeName
IDbCommanddbCmd
System.Objectobj
Type Parameters
  • T

GetFieldDefinitionMap(ModelDefinition)

View Source
Declaration
public Dictionary<string, FieldDefinition> GetFieldDefinitionMap(ModelDefinition modelDef)
Returns

Dictionary<System.String,ServiceStack.OrmLite.FieldDefinition>

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

SetParameterValue(FieldDefinition, IDataParameter, Object)

View Source
Declaration
public virtual void SetParameterValue(FieldDefinition fieldDef, IDataParameter p, object obj)
Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
IDataParameterp
System.Objectobj

SetParameterSize(FieldDefinition, IDataParameter)

View Source
Declaration
protected virtual void SetParameterSize(FieldDefinition fieldDef, IDataParameter p)
Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
IDataParameterp

GetValue(FieldDefinition, Object)

View Source
Declaration
protected virtual object GetValue(FieldDefinition fieldDef, object obj)
Returns

System.Object

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.Objectobj

GetFieldValue(FieldDefinition, Object)

View Source
Declaration
public object GetFieldValue(FieldDefinition fieldDef, object value)
Returns

System.Object

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.Objectvalue

GetFieldValue(Type, Object)

View Source
Declaration
public object GetFieldValue(Type fieldType, object value)
Returns

System.Object

Parameters
TypeName
TypefieldType
System.Objectvalue

GetValueOrDbNull(FieldDefinition, Object)

View Source
Declaration
protected virtual object GetValueOrDbNull(FieldDefinition fieldDef, object obj)
Returns

System.Object

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.Objectobj

GetQuotedValueOrDbNull<T>(FieldDefinition, Object)

View Source
Declaration
protected virtual object GetQuotedValueOrDbNull<T>(FieldDefinition fieldDef, object obj)
Returns

System.Object

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.Objectobj
Type Parameters
  • T

PrepareUpdateRowStatement(IDbCommand, Object, ICollection<String>)

View Source
Declaration
public virtual void PrepareUpdateRowStatement(IDbCommand dbCmd, object objWithProperties, ICollection<string> updateFields = null)
Parameters
TypeName
IDbCommanddbCmd
System.ObjectobjWithProperties
ICollection<System.String>updateFields

PrepareUpdateRowStatement<T>(IDbCommand, Dictionary<String, Object>, String)

View Source
Declaration
public virtual void PrepareUpdateRowStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args, string sqlFilter)
Parameters
TypeName
IDbCommanddbCmd
Dictionary<System.String,System.Object>args
System.StringsqlFilter
Type Parameters
  • T

PrepareUpdateRowAddStatement<T>(IDbCommand, Dictionary<String, Object>, String)

View Source
Declaration
public virtual void PrepareUpdateRowAddStatement<T>(IDbCommand dbCmd, Dictionary<string, object> args, string sqlFilter)
Parameters
TypeName
IDbCommanddbCmd
Dictionary<System.String,System.Object>args
System.StringsqlFilter
Type Parameters
  • T

ToDeleteStatement(Type, String, Object[])

View Source
Declaration
public virtual string ToDeleteStatement(Type tableType, string sqlFilter, params object[] filterParams)
Returns

System.String

Parameters
TypeName
TypetableType
System.StringsqlFilter
System.Object[]filterParams

HasInsertReturnValues(ModelDefinition)

View Source
Declaration
public virtual bool HasInsertReturnValues(ModelDefinition modelDef)
Returns

System.Boolean

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetDefaultValue(Type, String)

View Source
Declaration
public string GetDefaultValue(Type tableType, string fieldName)
Returns

System.String

Parameters
TypeName
TypetableType
System.StringfieldName

GetDefaultValue(FieldDefinition)

View Source
Declaration
public virtual string GetDefaultValue(FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

ResolveFragment(String)

View Source
Declaration
public virtual string ResolveFragment(string sql)
Returns

System.String

Parameters
TypeName
System.Stringsql

GetAutoIdDefaultValue(FieldDefinition)

View Source
Declaration
public virtual string GetAutoIdDefaultValue(FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.FieldDefinitionfieldDef

GetFieldDefinitions(ModelDefinition)

View Source
Declaration
public static IEnumerable<FieldDefinition> GetFieldDefinitions(ModelDefinition modelDef)
Returns

IEnumerable<ServiceStack.OrmLite.FieldDefinition>

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

ToCreateSchemaStatement(String)

View Source
Declaration
public abstract string ToCreateSchemaStatement(string schemaName)
Returns

System.String

Parameters
TypeName
System.StringschemaName

GetSchemas(IDbCommand)

View Source
Declaration
public virtual List<string> GetSchemas(IDbCommand dbCmd)
Returns

List<System.String>

Parameters
TypeName
IDbCommanddbCmd

GetSchemaTables(IDbCommand)

View Source
Declaration
public virtual Dictionary<string, List<string>> GetSchemaTables(IDbCommand dbCmd)
Returns

Dictionary<System.String,List<System.String>>

Parameters
TypeName
IDbCommanddbCmd

DoesSchemaExist(IDbCommand, String)

View Source
Declaration
public abstract bool DoesSchemaExist(IDbCommand dbCmd, string schemaName)
Returns

System.Boolean

Parameters
TypeName
IDbCommanddbCmd
System.StringschemaName

DoesSchemaExistAsync(IDbCommand, String, CancellationToken)

View Source
Declaration
public virtual Task<bool> DoesSchemaExistAsync(IDbCommand dbCmd, string schema, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDbCommanddbCmd
System.Stringschema
CancellationTokentoken

ToCreateTableStatement(Type)

View Source
Declaration
public virtual string ToCreateTableStatement(Type tableType)
Returns

System.String

Parameters
TypeName
TypetableType

GetUniqueConstraints(ModelDefinition)

View Source
Declaration
public virtual string GetUniqueConstraints(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetUniqueConstraintName(UniqueConstraintAttribute, String)

View Source
Declaration
protected virtual string GetUniqueConstraintName(UniqueConstraintAttribute constraint, string tableName)
Returns

System.String

Parameters
TypeName
ServiceStack.DataAnnotations.UniqueConstraintAttributeconstraint
System.StringtableName

GetCheckConstraint(ModelDefinition, FieldDefinition)

View Source
Declaration
public virtual string GetCheckConstraint(ModelDefinition modelDef, FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef
ServiceStack.OrmLite.FieldDefinitionfieldDef

ToPostCreateTableStatement(ModelDefinition)

View Source
Declaration
public virtual string ToPostCreateTableStatement(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

ToPostDropTableStatement(ModelDefinition)

View Source
Declaration
public virtual string ToPostDropTableStatement(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetForeignKeyOnDeleteClause(ForeignKeyConstraint)

View Source
Declaration
public virtual string GetForeignKeyOnDeleteClause(ForeignKeyConstraint foreignKey)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ForeignKeyConstraintforeignKey

GetForeignKeyOnUpdateClause(ForeignKeyConstraint)

View Source
Declaration
public virtual string GetForeignKeyOnUpdateClause(ForeignKeyConstraint foreignKey)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ForeignKeyConstraintforeignKey

ToCreateIndexStatements(Type)

View Source
Declaration
public virtual List<string> ToCreateIndexStatements(Type tableType)
Returns

List<System.String>

Parameters
TypeName
TypetableType

DoesTableExist(IDbConnection, String, String)

View Source
Declaration
public virtual bool DoesTableExist(IDbConnection db, string tableName, string schema = null)
Returns

System.Boolean

Parameters
TypeName
IDbConnectiondb
System.StringtableName
System.Stringschema

DoesTableExistAsync(IDbConnection, String, String, CancellationToken)

View Source
Declaration
public virtual async Task<bool> DoesTableExistAsync(IDbConnection db, string tableName, string schema = null, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDbConnectiondb
System.StringtableName
System.Stringschema
CancellationTokentoken

DoesTableExist(IDbCommand, String, String)

View Source
Declaration
public virtual bool DoesTableExist(IDbCommand dbCmd, string tableName, string schema = null)
Returns

System.Boolean

Parameters
TypeName
IDbCommanddbCmd
System.StringtableName
System.Stringschema

DoesTableExistAsync(IDbCommand, String, String, CancellationToken)

View Source
Declaration
public virtual Task<bool> DoesTableExistAsync(IDbCommand dbCmd, string tableName, string schema = null, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDbCommanddbCmd
System.StringtableName
System.Stringschema
CancellationTokentoken

DoesColumnExist(IDbConnection, String, String, String)

View Source
Declaration
public virtual bool DoesColumnExist(IDbConnection db, string columnName, string tableName, string schema = null)
Returns

System.Boolean

Parameters
TypeName
IDbConnectiondb
System.StringcolumnName
System.StringtableName
System.Stringschema

DoesColumnExistAsync(IDbConnection, String, String, String, CancellationToken)

View Source
Declaration
public virtual Task<bool> DoesColumnExistAsync(IDbConnection db, string columnName, string tableName, string schema = null, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDbConnectiondb
System.StringcolumnName
System.StringtableName
System.Stringschema
CancellationTokentoken

DoesSequenceExist(IDbCommand, String)

View Source
Declaration
public virtual bool DoesSequenceExist(IDbCommand dbCmd, string sequence)
Returns

System.Boolean

Parameters
TypeName
IDbCommanddbCmd
System.Stringsequence

DoesSequenceExistAsync(IDbCommand, String, CancellationToken)

View Source
Declaration
public virtual Task<bool> DoesSequenceExistAsync(IDbCommand dbCmd, string sequenceName, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDbCommanddbCmd
System.StringsequenceName
CancellationTokentoken

GetIndexName(Boolean, String, String)

View Source
Declaration
protected virtual string GetIndexName(bool isUnique, string modelName, string fieldName)
Returns

System.String

Parameters
TypeName
System.BooleanisUnique
System.StringmodelName
System.StringfieldName

GetCompositeIndexName(CompositeIndexAttribute, ModelDefinition)

View Source
Declaration
protected virtual string GetCompositeIndexName(CompositeIndexAttribute compositeIndex, ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.DataAnnotations.CompositeIndexAttributecompositeIndex
ServiceStack.OrmLite.ModelDefinitionmodelDef

GetCompositeIndexNameWithSchema(CompositeIndexAttribute, ModelDefinition)

View Source
Declaration
protected virtual string GetCompositeIndexNameWithSchema(CompositeIndexAttribute compositeIndex, ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.DataAnnotations.CompositeIndexAttributecompositeIndex
ServiceStack.OrmLite.ModelDefinitionmodelDef

ToCreateIndexStatement(Boolean, String, ModelDefinition, String, Boolean, FieldDefinition)

View Source
Declaration
protected virtual string ToCreateIndexStatement(bool isUnique, string indexName, ModelDefinition modelDef, string fieldName, bool isCombined = false, FieldDefinition fieldDef = null)
Returns

System.String

Parameters
TypeName
System.BooleanisUnique
System.StringindexName
ServiceStack.OrmLite.ModelDefinitionmodelDef
System.StringfieldName
System.BooleanisCombined
ServiceStack.OrmLite.FieldDefinitionfieldDef

ToCreateSequenceStatements(Type)

View Source
Declaration
public virtual List<string> ToCreateSequenceStatements(Type tableType)
Returns

List<System.String>

Parameters
TypeName
TypetableType

ToCreateSequenceStatement(Type, String)

View Source
Declaration
public virtual string ToCreateSequenceStatement(Type tableType, string sequenceName)
Returns

System.String

Parameters
TypeName
TypetableType
System.StringsequenceName

SequenceList(Type)

View Source
Declaration
public virtual List<string> SequenceList(Type tableType)
Returns

List<System.String>

Parameters
TypeName
TypetableType

SequenceListAsync(Type, CancellationToken)

View Source
Declaration
public virtual Task<List<string>> SequenceListAsync(Type tableType, CancellationToken token = null)
Returns

Task<List<System.String>>

Parameters
TypeName
TypetableType
CancellationTokentoken

ToExistStatement(Type, Object, String, Object[])

View Source
Declaration
public virtual string ToExistStatement(Type fromTableType, object objWithProperties, string sqlFilter, params object[] filterParams)
Returns

System.String

Parameters
TypeName
TypefromTableType
System.ObjectobjWithProperties
System.StringsqlFilter
System.Object[]filterParams

ToSelectFromProcedureStatement(Object, Type, String, Object[])

View Source
Declaration
public virtual string ToSelectFromProcedureStatement(object fromObjWithProperties, Type outputModelType, string sqlFilter, params object[] filterParams)
Returns

System.String

Parameters
TypeName
System.ObjectfromObjWithProperties
TypeoutputModelType
System.StringsqlFilter
System.Object[]filterParams

ToExecuteProcedureStatement(Object)

View Source
Declaration
public virtual string ToExecuteProcedureStatement(object objWithProperties)
Returns

System.String

Parameters
TypeName
System.ObjectobjWithProperties

GetModel(Type)

View Source
Declaration
protected static ModelDefinition GetModel(Type modelType)
Returns

ServiceStack.OrmLite.ModelDefinition

Parameters
TypeName
TypemodelType

SqlExpression<T>()

View Source
Declaration
public virtual SqlExpression<T> SqlExpression<T>()
Returns

ServiceStack.OrmLite.SqlExpression<T>

Type Parameters
  • T

CreateParameterizedDeleteStatement(IDbConnection, Object)

View Source
Declaration
public IDbCommand CreateParameterizedDeleteStatement(IDbConnection connection, object objWithProperties)
Returns

IDbCommand

Parameters
TypeName
IDbConnectionconnection
System.ObjectobjWithProperties

GetDropForeignKeyConstraints(ModelDefinition)

View Source
Declaration
public virtual string GetDropForeignKeyConstraints(ModelDefinition modelDef)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.ModelDefinitionmodelDef

ToAddColumnStatement(String, String, FieldDefinition)

View Source
Declaration
public virtual string ToAddColumnStatement(string schema, string table, FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
System.Stringschema
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

ToAlterColumnStatement(String, String, FieldDefinition)

View Source
Declaration
public virtual string ToAlterColumnStatement(string schema, string table, FieldDefinition fieldDef)
Returns

System.String

Parameters
TypeName
System.Stringschema
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef

ToChangeColumnNameStatement(String, String, FieldDefinition, String)

View Source
Declaration
public virtual string ToChangeColumnNameStatement(string schema, string table, FieldDefinition fieldDef, string oldColumn)
Returns

System.String

Parameters
TypeName
System.Stringschema
System.Stringtable
ServiceStack.OrmLite.FieldDefinitionfieldDef
System.StringoldColumn

ToRenameColumnStatement(String, String, String, String)

View Source
Declaration
public virtual string ToRenameColumnStatement(string schema, string table, string oldColumn, string newColumn)
Returns

System.String

Parameters
TypeName
System.Stringschema
System.Stringtable
System.StringoldColumn
System.StringnewColumn

ToAddForeignKeyStatement<T, TForeign>(Expression<Func<T, Object>>, Expression<Func<TForeign, Object>>, OnFkOption, OnFkOption, String)

View Source
Declaration
public virtual string ToAddForeignKeyStatement<T, TForeign>(Expression<Func<T, object>> field, Expression<Func<TForeign, object>> foreignField, OnFkOption onUpdate, OnFkOption onDelete, string foreignKeyName = null)
Returns

System.String

Parameters
TypeName
Expression<Func<<T>,System.Object>>field
Expression<Func<<TForeign>,System.Object>>foreignField
ServiceStack.OrmLite.OnFkOptiononUpdate
ServiceStack.OrmLite.OnFkOptiononDelete
System.StringforeignKeyName
Type Parameters
  • T
  • TForeign

ToCreateIndexStatement<T>(Expression<Func<T, Object>>, String, Boolean)

View Source
Declaration
public virtual string ToCreateIndexStatement<T>(Expression<Func<T, object>> field, string indexName = null, bool unique = false)
Returns

System.String

Parameters
TypeName
Expression<Func<<T>,System.Object>>field
System.StringindexName
System.Booleanunique
Type Parameters
  • T

FkOptionToString(OnFkOption)

View Source
Declaration
protected virtual string FkOptionToString(OnFkOption option)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.OnFkOptionoption

GetQuotedValue(Object, Type)

View Source
Declaration
public virtual string GetQuotedValue(object value, Type fieldType)
Returns

System.String

Parameters
TypeName
System.Objectvalue
TypefieldType

GetParamValue(Object, Type)

View Source
Declaration
public virtual object GetParamValue(object value, Type fieldType)
Returns

System.Object

Parameters
TypeName
System.Objectvalue
TypefieldType

InitQueryParam(IDbDataParameter)

View Source
Declaration
public virtual void InitQueryParam(IDbDataParameter param)
Parameters
TypeName
IDbDataParameterparam

InitUpdateParam(IDbDataParameter)

View Source
Declaration
public virtual void InitUpdateParam(IDbDataParameter param)
Parameters
TypeName
IDbDataParameterparam

EscapeWildcards(String)

View Source
Declaration
public virtual string EscapeWildcards(string value)
Returns

System.String

Parameters
TypeName
System.Stringvalue

GetLoadChildrenSubSelect<From>(SqlExpression<From>)

View Source
Declaration
public virtual string GetLoadChildrenSubSelect<From>(SqlExpression<From> expr)
Returns

System.String

Parameters
TypeName
ServiceStack.OrmLite.SqlExpression<T>expr
Type Parameters
  • From

ToRowCountStatement(String)

View Source
Declaration
public virtual string ToRowCountStatement(string innerSql)
Returns

System.String

Parameters
TypeName
System.StringinnerSql

ToDropColumnStatement(String, String, String)

View Source
Declaration
public virtual string ToDropColumnStatement(string schema, string table, string column)
Returns

System.String

Parameters
TypeName
System.Stringschema
System.Stringtable
System.Stringcolumn

ToTableNamesStatement(String)

View Source
Declaration
public virtual string ToTableNamesStatement(string schema)
Returns

System.String

Parameters
TypeName
System.Stringschema

ToTableNamesWithRowCountsStatement(Boolean, String)

View Source
Declaration
public virtual string ToTableNamesWithRowCountsStatement(bool live, string schema)
Returns

System.String

Parameters
TypeName
System.Booleanlive
System.Stringschema

SqlConflict(String, String)

View Source
Declaration
public virtual string SqlConflict(string sql, string conflictResolution)
Returns

System.String

Parameters
TypeName
System.Stringsql
System.StringconflictResolution

SqlConcat(IEnumerable<Object>)

View Source
Declaration
public virtual string SqlConcat(IEnumerable<object> args)
Returns

System.String

Parameters
TypeName
IEnumerable<System.Object>args

SqlCurrency(String)

View Source
Declaration
public virtual string SqlCurrency(string fieldOrValue)
Returns

System.String

Parameters
TypeName
System.StringfieldOrValue

SqlCurrency(String, String)

View Source
Declaration
public virtual string SqlCurrency(string fieldOrValue, string currencySymbol)
Returns

System.String

Parameters
TypeName
System.StringfieldOrValue
System.StringcurrencySymbol

SqlBool(Boolean)

View Source
Declaration
public virtual string SqlBool(bool value)
Returns

System.String

Parameters
TypeName
System.Booleanvalue

SqlLimit(Nullable<Int32>, Nullable<Int32>)

View Source
Declaration
public virtual string SqlLimit(int? offset = null, int? rows = null)
Returns

System.String

Parameters
TypeName
System.Nullable<System.Int32>offset
System.Nullable<System.Int32>rows

SqlCast(Object, String)

View Source
Declaration
public virtual string SqlCast(object fieldOrValue, string castAs)
Returns

System.String

Parameters
TypeName
System.ObjectfieldOrValue
System.StringcastAs

OpenAsync(IDbConnection, CancellationToken)

View Source
Declaration
public virtual Task OpenAsync(IDbConnection db, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IDbConnectiondb
CancellationTokentoken

ExecuteReaderAsync(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task<IDataReader> ExecuteReaderAsync(IDbCommand cmd, CancellationToken token = null)
Returns

Task<IDataReader>

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken

ExecuteNonQueryAsync(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task<int> ExecuteNonQueryAsync(IDbCommand cmd, CancellationToken token = null)
Returns

Task<System.Int32>

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken

ExecuteScalarAsync(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task<object> ExecuteScalarAsync(IDbCommand cmd, CancellationToken token = null)
Returns

Task<System.Object>

Parameters
TypeName
IDbCommandcmd
CancellationTokentoken

ReadAsync(IDataReader, CancellationToken)

View Source
Declaration
public virtual Task<bool> ReadAsync(IDataReader reader, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
IDataReaderreader
CancellationTokentoken

ReaderEach<T>(IDataReader, Func<T>, CancellationToken)

View Source
Declaration
public virtual async Task<List<T>> ReaderEach<T>(IDataReader reader, Func<T> fn, CancellationToken token = null)
Returns

Task<List<<T>>>

Parameters
TypeName
IDataReaderreader
Func<<T>>fn
CancellationTokentoken
Type Parameters
  • T

ReaderEach<Return>(IDataReader, Action, Return, CancellationToken)

View Source
Declaration
public virtual async Task<Return> ReaderEach<Return>(IDataReader reader, Action fn, Return source, CancellationToken token = null)
Returns

Task<<Return>>

Parameters
TypeName
IDataReaderreader
Actionfn
<Return>source
CancellationTokentoken
Type Parameters
  • Return

ReaderRead<T>(IDataReader, Func<T>, CancellationToken)

View Source
Declaration
public virtual async Task<T> ReaderRead<T>(IDataReader reader, Func<T> fn, CancellationToken token = null)
Returns

Task<<T>>

Parameters
TypeName
IDataReaderreader
Func<<T>>fn
CancellationTokentoken
Type Parameters
  • T

InsertAndGetLastInsertIdAsync<T>(IDbCommand, CancellationToken)

View Source
Declaration
public virtual Task<long> InsertAndGetLastInsertIdAsync<T>(IDbCommand dbCmd, CancellationToken token)
Returns

Task<System.Int64>

Parameters
TypeName
IDbCommanddbCmd
CancellationTokentoken
Type Parameters
  • T

Implements